import { getStore, setStore, removeStore } from "./store";

const adminId = "ADMIN-ID";
const adminToken = "ADMIN-TOKEN";
const language = "ADMIN-LANGUAGE"
const routers = "ADMIN-ROUTER"

// 获取token
export function getToken() {
    return getStore(adminToken);
}

// 设置token
export function setToken(sid) {
    return setStore(adminToken, sid, 365);
}

// 删除token
export function removeToken() {
    return removeStore(adminToken);
}

// 获取admin_id
export function getAdminId() {
    return getStore(adminId);
}

// 设置admin_id
export function setAdminId(id) {
    return setStore(adminId, id, 365);
}

// 删除admin_id
export function removeAdminId() {
    return removeStore(adminId);
}

// 获取admin_language
export function getLanguage() {
    return getStore(language);
}

// 设置admin_language
export function setLanguage(adminlanguage) {
    return setStore(language, adminlanguage, 365);
}

// 删除admin_language
export function removeLanguage() {
    return removeStore(language);
}
// 获取admin_language
export function getRouters() {

    return JSON.parse(sessionStorage.getItem(routers))
    return getStore(routers);
}

// 设置admin_language
export function setRouters(adminrouters) {
    return sessionStorage.setItem(routers, adminrouters)
    return setStore(routers, adminrouters, 365);
}

// 删除admin_language
export function removeRouters() {
    return sessionStorage.removeItem(routers)
    return removeStore(routers);
}
